<?php

use yii\db\Migration;
use yii\db\Schema;

/**
 * Class m181025_095410_ADD_FIELD_SUPPIER
 */
class m181025_095410_ADD_FIELD_SUPPIER extends Migration
{
    /**
     * {@inheritdoc}
     */
    public function safeUp()
    {

        $this->addColumn('{{supplier}}', 'person', Schema::TYPE_STRING. "(64) NULL COMMENT '联系人' AFTER is_tour ");

        $this->addColumn('{{supplier}}', 'address', Schema::TYPE_STRING. "(256) NULL COMMENT '地址' AFTER phone");

        $this->alterColumn('{{supplier}}', 'phone', Schema::TYPE_STRING. "(64)  NULL   COMMENT '联系电话' ");

        $this->alterColumn('{{supplier}}', 'city', Schema::TYPE_STRING. "(64)  NULL   COMMENT '城市' ");
    }

    /**
     * {@inheritdoc}
     */
    public function safeDown()
    {
        echo "m181025_095410_ADD_FIELD_SUPPIER cannot be reverted.\n";

        return false;
    }

    /*
    // Use up()/down() to run migration code without a transaction.
    public function up()
    {

    }

    public function down()
    {
        echo "m181025_095410_ADD_FIELD_SUPPIER cannot be reverted.\n";

        return false;
    }
    */
}
